package com.codingman.springmybatisdemo1;

import org.apache.ibatis.session.SqlSession;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {

	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		// SqlSessionTemplate
		SqlSession session = (SqlSession) ctx.getBean("sqlSession");

		Employee e = new Employee(101, "Ann", 100.0);
		// namespace.id
		session.insert("springmybatisdemo1.EmployeeMapper.insertEmployee", e);
	}

}
